/*
 * Copyright© 2003-2019 浙江汇信科技有限公司, All Rights Reserved.
 */
package com.icinfo.cloud.provider.punish.dataprocessing.service.impl;

import cn.hutool.core.collection.CollectionUtil;
import com.icinfo.cloud.provider.punish.dataprocessing.mapper.DataProcessDocConfigInfoMapper;
import com.icinfo.cloud.provider.punish.dataprocessing.model.DataProcessDocConfigInfo;
import com.icinfo.cloud.provider.punish.dataprocessing.service.IDataProcessDocConfigInfoService;
import com.icinfo.framework.core.service.support.MyBatisServiceSupport;
import com.icinfo.framework.mybatis.mapper.entity.Example;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 描述:  data_process_doc_config_info 对应的Service接口实现类.<br>
 *
 * @author framework generator
 * @date 2023年02月03日
 */
@Service
public class DataProcessDocConfigInfoServiceImpl extends MyBatisServiceSupport implements IDataProcessDocConfigInfoService {
    /**
     * 日志记录器
     */
    private static final Logger logger = LoggerFactory.getLogger(DataProcessDocConfigInfoServiceImpl.class);

    @Autowired
    private DataProcessDocConfigInfoMapper dataProcessDocConfigInfoMapper;

    /**
     * 获取文书目录编码列表
     *
     * @param type 类型（1：案件，2：案源）
     * @return 目录编码列表
     * @author lilihao
     * @date 2023/2/7 14:24
     */
    @Override
    public List<DataProcessDocConfigInfo> getDocumentCatalogCodeList(String type) {
        Example example = new Example(DataProcessDocConfigInfo.class);
        example.createCriteria().andEqualTo("type", type);
        example.orderBy("sort").asc();
        return  dataProcessDocConfigInfoMapper.selectByExample(example);
    }
}